<table width = "100%" border = "1" align = "center">
  <tr>
    <td align = "left" valign = "top">
      <table width = "100%">
        <tr>
          <td width = "100%">
            <% form_remote_tag(:url => {:controller => "drug", :action => "filter_sideffects", :id => @drug.id}, :update => "drug_sideffects") do %>
              Sex: <%= select_tag(:sex, options_for_select({"Female" => "F", "Male" => "M", "All" => "All"}, "All")) %>
              Age: <%= select_tag(:age, options_for_select({"< 18" => "18", "18 - 45" => "45", "45 - 60" => "60", "60 +" => "inf", "All" => "All"}, "All")) %>
              Time Taken:<%= select_tag(:time_taken, options_for_select({"< 1 week" => "week", "1 week - 1 month" => "month", "1 month - 3 months" => "season", "3 months - 6 months" => "half_year", "6 months - 1 year" => "year", "1 year +" => "inf", "All" => "All"}, "All")) %>
              <%= submit_tag("Filter") %>
            <% end %>
          </td>
        </tr>
        <tr>
          <td width = "100%" aligh = "left">
            <div id = "drug_sideffects">
              <%= render :partial => "drug_sideffects"%>
            </div>
          </td>
        </tr>
      </table>
    </td>
    <td align = "right" valign = "top" width = "450px">
      <div id = "drug_charts">
        <table border = "0" width = "100%">
          <tr>
            <td>General Statistics:</td>
          </tr>
          <tr>
            <td>
              <% chart = GoogleChart.pie_450x200(normalize_hash_value(@sex_stats)) %>
              <% chart.title = "Sex Distribution" %>
              <% chart.title_color = "0000FF" %>
              <% chart.title_size = 18 %>
              <% chart.colors = "0000FF"%>
              <%= image_tag(chart.to_url) %>
              <br />
              <br />
              <br />
              <% chart = GoogleChart.pie_450x200(normalize_hash_value(@age_stats)) %>
              <% chart.title = "Age Distribution" %>
              <% chart.title_color = "00FF00" %>
              <% chart.title_size = 18 %>
              <% chart.colors = "00FF00"%>
              <%= image_tag(chart.to_url) %>
              <br />
              <br />
              <br />
              <% chart = GoogleChart.pie_450x200(normalize_hash_value(@time_taken_stats)) %>
              <% chart.title = "Time Taken Distribution" %>
              <% chart.title_color = "FF0000" %>
              <% chart.title_size = 18 %>
              <% chart.colors = "FF0000"%>
              <%= image_tag(chart.to_url) %>
            </td>
          </tr>
        </table>
      </div>
    </td>
  </tr>
</table>